package com.tool4j.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tool4j.entity.User;
import com.tool4j.entity.params.LoginParams;

import java.util.List;

/**
 * @author Deng.Weiping
 * @since 2023-10-28 11:27:36
 */
public interface UserService extends IService<User> {

    List<User> findList(User params);

    User findById(Long id);

    User findByUserId(Long userId);

    boolean insert(User user);

    boolean update(User user);

    int delete(Long id);

    /**
     * 创建用户
     *
     * @return
     */
    User init(LoginParams params);

    /**
     * 账号是否存在
     * <p>
     * 注意：包括已被注销或停用的账号！！！
     *
     * @param params
     * @return
     */
    User exists(LoginParams params);

    Boolean delAccount(Long userId);

    User findByPhoneNum(String phoneNum);

    User findByEmail(String email);

    void updateRole(Long userId, String vipType);

    void modifyPwd(LoginParams params);
}